package fmglemmings;

import java.util.logging.Logger;

public abstract class MapObject implements EventListener {
//	protected static GameField gf;
	private static Logger logger = Logger.getLogger("fmglemmings");
	protected static RequestListener gf;
	protected boolean block=false;
	protected boolean destructable=true;
	protected boolean move=false;
	protected boolean hastop=false;
	protected boolean lifting=false;
	protected boolean liftdir=false;
	protected boolean goal=false;
	
	protected int X,Y,dir;
	
	/**
	 * GF refenrencia beállítása
	 * @param agf Referencia a GF-re
	 */
	public void setGF(GameField agf){
		gf=agf;
	}
	/**
	 * Irany beallitasa
	 * @param dire irany 
	 */
        public void setDirection(int dire) {
                dir=dire;
//		logger.info("Boritek: irany beallitasa");
	}
	 
	/**
	 * Irany lekerdezese
	 * @return Irany
	 */
	public int getDirection() {
//		logger.info("Boritek: irany lekerdezese");
		return dir;
	}
	/**
	 * X koordinata beallitasa
	 * @param x 
	 */
        public void setX(int x) {
            X=x;
//		logger.info	("Boritek: X beallitasa");
	}
	 
	/**
	 * Y koordinata beallitasa
	 * @param y 
	 */
	public void setY(int y) {
            Y=y;
//		logger.info("Boritek: Y beallitasa");
	}
	 
	/**
	 * X lekeredezese
	 * @return 
	 */
	public int getX() {
//		logger.info("Boritek:X koordinata lekerdezese");
		return X;
	}
	 
	/**
	 * Y lekerdezese
	 * @return 
	 */
	public int getY() {
//		logger.info("Boritek:Y koordinata lekerdezese");
		return Y;
	}
	/**
	 * Blokkolasi tulajdonsag lekerdezese
	 * @return 
	 */
	public boolean isBlock() {
		return block;
	}
	 
	/**
	 * Elpusztithatpsag lekerdezese
	 * @return 
	 */
	public boolean isDestructable() {
		return destructable;
	}
	 
	/**
	 * Celkent viselkedes lekerdezese
	 * @return 
	 */
	public boolean isGoal() {
		return goal;
	}
	 
	/**
	 * Emelesi irany lekerdezse
	 */
	public boolean getLiftDir() {
		return liftdir;
	}
	 
	/**
	 * Emelekdes lekerdezese
	 * @return 
	 */
	public boolean isLift() {
		return lifting;
	}
	 
	/**
	 * Teto lekeredezese
	 */
	public boolean hasTop() {
		return hastop;
	}
	 
	public void draw() {
	}
	 
	/**
	 * Mozogas allapot lekerdezese
	 */
	public boolean isMove() {
		return move;
	}
	 
	/**
	 *@see EventListener#fallEvent()
	 */
	public void fallEvent() {
                
	}
	/**
	 * Koronket kapott esemeny
	 */
	public void tickEvent(){
	}
	 
	/**
	 * Utkozes
	 * @see EventListener#hitEvent()
	 */
	public void hitEvent(MapObject mo) {
	}
	 
	/**
	 *@see EventListener#bombEvent()
	 */
	public void bombEvent() {
//            logger.info("Objektum felrobbant X:"+X+"Y:"+Y);
            gf.removeRequest(this);
	}
	 
	/**
	 *@see EventListener#fallenEvent()
	 */
	public void fallenEvent() {
	}
	
	/**
	 * A konstruktor
	 * @param ax X koordinata
	 * @param ay Y koordinata
	 * @param ad Irany
	 */
	public MapObject(int ax, int ay, int ad){
		X=ax;
		Y=ay;
		dir=ad;
	}
	 
}
 
